package com.shiwaixiangcun.customer.adapter;

import android.support.annotation.Nullable;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.shiwaixiangcun.customer.R;
import com.shiwaixiangcun.customer.module.heath.EvaluationData;

import java.util.List;

/**
 * Author   Administrator
 * Date     2018/2/7
 * Desc     eg
 *
 * @author Administrator
 */

public class AdapterEvaluationRecord extends BaseQuickAdapter<EvaluationData, BaseViewHolder> {
    public AdapterEvaluationRecord(@Nullable List<EvaluationData> data) {
        super(R.layout.item_evaluation, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, EvaluationData item) {
        String title;
        int cover;
        switch (item.getAssessmentType()) {
            case "Chinese_Medicine":
                title = "中医体质辨识";
                cover = R.drawable.icon_health_ctcm;
                break;
            case "Dietary_Dabits":
                title = "饮食生活习惯测评";
                cover = R.drawable.icon_health_lifestyle;
                break;
            case "Circulatory_System":
                title = "循环系统健康测评";
                cover = R.drawable.icon_health_cyclic;
                break;
            case "Immune_System":
                title = "免疫系统健康测评";
                cover = R.drawable.icon_health_immune;
                break;
            case "Endocrine_System":
                title = "内分泌系统健康测评";
                cover = R.drawable.icon_health_endocrinium;
                break;
            case "Respiratory_System":
                title = "呼吸系统健康测评";
                cover = R.drawable.icon_health_respiratory;
                break;
            case "Sport_System":
                title = "运动系统健康测评";
                cover = R.drawable.icon_health_motor;
                break;
            case "Psychology_System":
                title = "心理健康测评";
                cover = R.drawable.icon_health_mental;
                break;
            case "Man_System":
                title = "男性健康测评";
                cover = R.drawable.icon_health_male;
                break;
            case "Woman_System":
                title = "女性健康测评";
                cover = R.drawable.icon_health_female;
                break;
            case "Digestive_System":
                title = "消化系统历史测评";
                cover = R.drawable.icon_health_digestive;
                break;
            default:
                title = item.getAssessmentType();
                cover = R.drawable.icon_health_male;
        }
        helper.setText(R.id.tv_title, title);
        ImageView imageView = helper.getView(R.id.iv_flag);
        helper.setText(R.id.tv_time, item.getCreateDate());
        Glide.with(mContext).load(cover).into(imageView);

    }
}
